<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateLivesTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('lives', function (Blueprint $table) {
//            $table->comment('直播管理表');
            $table->bigIncrements('id')->comment('ID');
            $table->bigInteger('data_version_id')->default(0)->comment('学期ID');
            $table->string('name', 128)->default('')->comment('标题');
            $table->string('subject', 255)->nullable()->default('')->comment('学科');
            $table->integer('subject_dic_id')->nullable()->default(0)->comment('学科字典id');
            $table->string('grade', 255)->nullable()->default('')->comment('年级');
            $table->integer('grade_dic_id')->nullable()->default(0)->comment('年级字典id');
            $table->string('live_time', 64)->nullable()->comment('直播时间');
            $table->dateTime('start_time')->nullable()->comment('开始时间');
            $table->dateTime('end_time')->nullable()->comment('结束时间');
            $table->string('place', 255)->nullable()->default('')->comment('直播教室');
            $table->string('host', 255)->nullable()->default('')->comment('主讲人');
            $table->boolean('status')->nullable()->default(false)->comment('预约状态：1-成功，2-失败，3-取消');
            $table->integer('creator_id')->nullable()->comment('创建人关联ID');
            $table->dateTime('created_at')->nullable()->comment('创建时间');
            $table->dateTime('updated_at')->nullable()->comment('更新时间');
            $table->boolean('deleted')->nullable()->default(false)->comment('删除：1-已删除');
            $table->boolean('is_sub')->nullable()->default(false)->comment('提交：1-已提交');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('lives');
    }
};
